package com.liqi.frame.comm.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author liqi on 2019/10/16 0016. liqiwork@qq.com
 */
@Component
@ConfigurationProperties(prefix = "app.qiniu")
@Data
public class QiniuProperties {
    /**
     * 访问秘钥
     */
    private String accessKey;
    /**
     * 授权秘钥
     */
    private String secretKey;
    /**
     * 存储空间名称（公共）
     */
    private String publicBucket;
    private String privateBucket;
    private String callbackURL;
    private String publicIMGURL;
    private String priviteIMGURL;
    /**
     * 外链域名
     */
    private String domain;

    private static String accessKeyStatic;
    @PostConstruct
    public void setAccessKeyStatic(){
        accessKeyStatic = this.accessKey;
    }
    public static String getAccessKeyStatic(){
        return accessKeyStatic;
    }

    private static String secretKeyStatic;
    @PostConstruct
    public void setSecretKeyStatic(){
        secretKeyStatic = this.secretKey;
    }
    public static String getSecretKeyStatic(){
        return secretKeyStatic;
    }

    private static String publicBucketStatic;
    @PostConstruct
    public void setPublicBucketStatic(){
        publicBucketStatic = this.publicBucket;
    }
    public static String getPublicBucketStatic(){
        return publicBucketStatic;
    }
}
